<template>
	<view class="anchor" :class="{'fixedtop': fixedtop}">
		<view class="item"
			:class="{active: tabs.currentTab === key}"
			v-for="(value, key, i) in tabs.items"
			:key="key"
			@click="ontab(i,key)"
		>
		   {{value}}
		</view>
	</view>
</template>

<script>
	export default {
		props: ['tabs', 'fixedtop'],
		data () {
			return {
				
			}
		},
		methods: {
			ontab (i, key) {
				this.$emit('tab', {index: i, key: key})
				this.tabs.currentTab = key
			}
		},
		created (){
			
		}
	}
</script>

<style scoped>
	.anchor{display:flex; align-items:center; height:90upx; text-align: center;}
	.anchor .item{color:#666; font-size:30upx; flex-grow:1; line-height: 90upx;}
	.anchor .active{color:#fe9900; font-weight: bold; border-bottom:2px solid #fe9900;}
	.anchor.fixedtop{position: fixed;width: 100%;background: #FFF;z-index: 250;
		top: 44px;
	/* #ifdef APP-PLUS */
		top: 0;
	/* #endif */
	}
	
</style>
